package com.utils;
import org.junit.Test;

import java.sql.*;

public class last {
    @Test
    public void sdf(){
        Connection connection=null;
        PreparedStatement p=null;
        Statement st=null;
        ResultSet rs=null;
        try {
            //获取数据库连接
            connection = JdbcUtils.getConnection();
            //获取Sql的执行对象
            st=connection.createStatement();
            //简单的查找
            String sql="select * from judge";
            rs = st.executeQuery(sql);
            while(rs.next()){
                System.out.println(rs.getString(1));
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            JdbcUtils.release(connection,st,rs);
        }
    }
}
